#include <iostream>
#include <string.h>
using namespace std;
int aa[101];
int main()
{
	int a,n;
	while(cin>>a>>n){
		if(a==0){
			cout<<0<<endl;
			continue;
		} 
		memset(aa,0,sizeof(aa));
		int jishu=0;
		int jinwei=0;
		for(int i=n;i>=1;i--){
			int temp=i*a+jinwei;
			jinwei=temp/10;
			aa[jishu]=temp%10;
			jishu++;
		}
		aa[jishu]=jinwei;
		if(aa[jishu]!=0) cout<<aa[jishu];
		for(int j=jishu-1;j>=0;j--) cout<<aa[j];
		cout<<endl;
	}
} 
